import org.apache.spark.{SparkConf, SparkContext}

object AccumulatorTest {

  def main(args: Array[String]): Unit = {
    val conf = new SparkConf().setAppName("BroadCastTest").setMaster("local")
    conf.set("spark.testing.memory", "2147480000")
    val sc = new SparkContext(conf)
    val bcv = sc.longAccumulator("Day Accumulator")
    val arr = List(1,2,3,4,5)
    val bcRdd = sc.parallelize(arr)
    bcRdd.foreach(x => bcv.add(x))
    println(bcv.value)

  }

}
